<%--
  Created by IntelliJ IDEA.
  User: 段某某
  Date: 2022/11/7
  Time: 14:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<!--头部-->
<div class="modal-header">
    <button class="close" data-dismiss="modal">&times;</button>
    <h3>修改权限</h3>
</div>
<form id="updaterole" class="form-horizontal">
    <!--身体-->
    <div class="modal-body">
        <div class="form-group">
            <label class="control-label col-md-2" for="auname">权限名称:</label>
            <div class="col-md-10">
                <input type="hidden" id="auid" name="auid">
                <input type="text" id="auname" name="auname" class="form-control" placeholder="请输入权限名称" required>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-2" for="auurl">权限路径:</label>
            <div class="col-md-10">
                <input type="text" id="auurl" name="auurl" class="form-control" placeholder="请输入权限路径" required>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-2">状态:</label>
            <div class="col-md-10">

            </div>
        </div>
    </div>
    <!--底部-->
    <div class="modal-footer">
        <div>
            <input type="button" id="btn1" value="修改权限" class="btn btn-info col-md-2 col-md-offset-2">
            <input type="reset" value="重置" class="btn btn-success col-md-2 col-md-offset-3">
            <input type="button" value="关闭" class="btn btn-danger col-md-2 col-md-offset-1">
        </div>

    </div>
</form>

<script>
    $("#btn1").click(function () {
    var params={
        url: 'updateauthorization.action',
        type:'post',
        dataType: 'json',
        success:function (data) {
            alert(data.msg);
            location.href="authorization.jsp"
        }
    }
    $("#updateauthorization").ajaxSubmit(params)
})
    //加载数据
    $(function () {
        var auid='${param.auid}'
        alert(auid)
        $.ajax({
            url:'querybyauid.action/'+auid,
            type:'post',
            dataType:'json',
            success:function (data) {
                console.log(data)
                $("#auid").val(data.auid);
                $("#auname").val(data.auname);
                $("#auurl").val(data.auurl);


            }
        })
    })
</script>

</body>
</html>
